window.onload = function(){
    var all = document.getElementById('all');
    var form = document.getElementsByTagName('form')[0];
    all.onclick = function(){
        // 获得表单内的所有表单
        for(var i=0;i<form.elements.length;i++){
            if(form.elements[i].name!='chkall'){
                form.elements[i].checked = form.chkall.checked;
            }
        }
    };
    form.onsubmit = function(){
        var result = confirm('你确定删除这批数据吗？');
        if(result){
            return true;
        }else{
            return false;
        }
    };
};